package com.gxar.file.server.base.common.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * @author linsy
 * @version 1.0
 * @created 2023/7/6 17:06
 */
@Getter
public enum ProductEnum {

    MATERIAL(0,"material", "素材"),
    DELIVERY(1,"delivery", "运营投放"),
    APP(2,"app", "应用管理"),
    ASSET(3,"asset", "资产管理"),
    QUICK_AR(4, "quick-ar", "QuickAR"),
    ;
    private final Integer code;
    private final String name;
    private final String desc;

    ProductEnum(Integer code, String name, String desc) {
        this.code = code;
        this.name = name;
        this.desc = desc;
    }

    public static Optional<ProductEnum> getByName(String name) {
        return Arrays.stream(ProductEnum.values()).filter(e -> e.getName().equals(name)).findFirst();
    }
}
